/*
 * Copyright Hundsun Technologies Inc. All Rights Reserved.
 */

package types

// event
const (
	//EventReply event reply
	EventReply = iota + 1
	//EventTxQuery Tx相关
	EventTxQuery
	//EventReplyTxQuery event reply tx query
	EventReplyTxQuery
	//EventTxTotalQuery event query amount of tx
	EventTxTotalQuery
	//EventReplyTxTotalQuery event reply amout of tx
	EventReplyTxTotalQuery
	//EventTxBroadcast event broadcast tx
	EventTxBroadcast
	//EventDelPendingPoolTxs event delete txs from txpool
	EventDelPendingPoolTxs
	//EventUndoDelPendingPoolTxs event undo delete txs in txpool
	EventUndoDelPendingPoolTxs
	//EventPreRemoveSpecialTxs event pre remove specific txs
	EventPreRemoveSpecialTxs
	//EventUndoPreRemoveTxs event undo pre remove txs
	EventUndoPreRemoveTxs

	//block相关
	//EventBroadcastAddBlock event broadcast add block
	EventBroadcastAddBlock
	//EventBroadcastAddBlockReply event reply broad add block
	EventBroadcastAddBlockReply
	//EventGetBlock event get block
	EventGetBlock
	//EventRequestBlock event request block
	EventRequestBlock
	//EventGetBlocks event get blocks
	EventGetBlocks
	//EventGetBlockExecResult event get block executed result
	EventGetBlockExecResult
	//EventGetBlockExecResults event get block executed results
	EventGetBlockExecResults
	//EventReplyGetBlocks event reply get blocks
	EventReplyGetBlocks
	//EventGetBlockByHash event get block by hash
	EventGetBlockByHash
	//EventGetBlocksByHashes event get blocks by hashes
	EventGetBlocksByHashes
	//EventGetBlockHeight event get block height
	EventGetBlockHeight
	//EventReplyBlockHeight event reply block height
	EventReplyBlockHeight
	//EventGetExecutedBlock event get executed block
	EventGetExecutedBlock
	//EventGetExecutedBlocks event get executed blocks
	EventGetExecutedBlocks
	//EventGetBlockNumber event get block number
	EventGetBlockNumber
	//EventGetBlockSequence event get block sequence
	EventGetBlockSequence
	//EventGetMaxExecutedBlockNumber event get max executed block number
	EventGetMaxExecutedBlockNumber
	//EventCheckBlock event check block
	EventCheckBlock
	//EventReplyCheckBlock event reply check block
	EventReplyCheckBlock
	//EventBlockBroadcast event broadcast block
	EventBlockBroadcast
	//EventGetLastBlock event get last block
	EventGetLastBlock
	//EventReplyGetLastBlock event reply get last block
	EventReplyGetLastBlock
	//EventGetLastExecutedBlock event get last executed block
	EventGetLastExecutedBlock
	//EventAddBlock event add block
	EventAddBlock // 区块链执行区块
	//EventReplyAddBlock evnet reply add block
	EventReplyAddBlock
	//EventSaveBlock event save block
	EventSaveBlock
	//EventReplySaveBlock event reply save block
	EventReplySaveBlock
	//EventReplyAddBlocks event reply add blocks
	EventReplyAddBlocks
	//EventAddSequenceCenterBlock event reply add blocks
	EventAddSequenceCenterBlock
	//EventReplyAddSequenceCenterBlock event reply add sequence center block
	EventReplyAddSequenceCenterBlock
	//EventStoreCurrentBlockSequence event store current block sequence
	EventStoreCurrentBlockSequence
	//EventQueryCurrentBlockSequence event query current block sequence
	EventQueryCurrentBlockSequence
	//EventDelBlock event delete block
	EventDelBlock // 区块链回退区块
	//EventReplyDelBlock event reply delete block
	EventReplyDelBlock
	//EventDelPendingPoolBlock event delete pending pool block
	EventDelPendingPoolBlock
	//EventExecutedBlockResult event get executed block result
	EventExecutedBlockResult // 已执行区块结果
	//EventReplyExecutedBlockResult event reply get executed block result
	EventReplyExecutedBlockResult
	//EventStoreReceivedBlockTopic event store received block
	EventStoreReceivedBlockTopic
	//EventStoreCheckedBlockTopic event store checked block
	EventStoreCheckedBlockTopic
	//EventStoreExecutedBlockTopic event store executed block
	EventStoreExecutedBlockTopic
	//EventStoreParaChainTxsCollectProgressTopic event store para chain txs
	EventStoreParaChainTxsCollectProgressTopic
	// 查询相关
	//EventQueryContract event query contract
	EventQueryContract // 查询合约
	//EventReplyQueryContract event reply query contract
	EventReplyQueryContract
	//EventQueryContractTotal event query amount of contracts
	EventQueryContractTotal
	//EventReplyQueryContractTotal event reply query amount of contracts
	EventReplyQueryContractTotal
	//EventQueryReceivedBlockTopic event query received block
	EventQueryReceivedBlockTopic
	//EventQueryCheckedBlockTopic event query checked block
	EventQueryCheckedBlockTopic
	//EventQueryExecutedBlockTopic event query executed block
	EventQueryExecutedBlockTopic
	//EventQueryParaChainTxsCollectProgressTopic event query para chain txs
	EventQueryParaChainTxsCollectProgressTopic
	//EventQuerySequenceCenterBlock event query sequence center block
	EventQuerySequenceCenterBlock
	//EventExecutedBlock event executed block
	EventExecutedBlock
	//EventCheckedBlock event check block
	EventCheckedBlock // 验证的块
	//EventReceivedBlock event received block
	EventReceivedBlock // 收到的区块
	//EventAddedBlock event added block
	EventAddedBlock // 存储的块
	//EventRequestCurrentSequence event query current sequence
	EventRequestCurrentSequence // sequence center中记录的区块高度

	// 执行相关
	//EventExecTxGroup event execute tx group
	EventExecTxGroup // 执行交易组
	//EventReplyExecTxGroup event reply execute tx group
	EventReplyExecTxGroup

	// p2p相关
	//EventPeerID event peerID
	EventPeerID
	//EventPeerList event peer list
	EventPeerList
	//EventReplyPeerList event reply peer list
	EventReplyPeerList
	//EventPeerInfo event peer info
	EventPeerInfo
	//EventReplyPeerInfo event reply peer info
	EventReplyPeerInfo
	//EventVerifyBlackList event verify black list
	EventVerifyBlackList
	//EventReplyVerifyBlackList event reply verify blacklist
	EventReplyVerifyBlackList
	//EventTxPoolAddTx p2p-txpool相关
	EventTxPoolAddTx
	//EventTxPoolAddTxs event tx pool add txs
	EventTxPoolAddTxs
	//EventTxPoolPreRemove event pre remove tx from txpool
	EventTxPoolPreRemove
	//EventTxPoolPreRemoveByHash event pre remove tx from txpool
	EventTxPoolPreRemoveByHash
	//EventTxPoolUndoPreRemove event undo pre remove tx from txpool
	EventTxPoolUndoPreRemove
	//EventTxPoolRemoveTxs event remove txs from txpool
	EventTxPoolRemoveTxs
	//EventTxPoolPeekTx event peek pending tx from txpool
	EventTxPoolPeekTx
	//EventTxPoolSize event query txpool size
	EventTxPoolSize
	//EventTxPoolHashes event query hashes of pending transactions in txpool
	EventTxPoolHashes
	//EventFetchBlock event fetch block
	EventFetchBlock
	//EventReplyFetchBlockInfo event reply fetch blockInfo
	EventReplyFetchBlockInfo

	// consensus相关
	//EventConsensusQuery event consensus query
	EventConsensusQuery
	//EventIsSynched event is node synchronized
	EventIsSynched
	//EventStoreElectionContext event store election context
	EventStoreElectionContext
	//EventRequestElectionContext event request election context
	EventRequestElectionContext
	//EventStoreRoundMinersInfo event store round miners info
	EventStoreRoundMinersInfo
	//EventRequestRoundMinersInfo event request round miners info
	EventRequestRoundMinersInfo
	//EventConsensusRequestMsg event consensus request message
	EventConsensusRequestMsg
	//EventConsensusSyncRequestMsg event consensus sync request
	EventConsensusSyncRequestMsg
	//EventConsensusResponseMsg event consensus response msg
	EventConsensusResponseMsg

	//EventBlockSequence blocksequense event
	EventBlockSequence

	//EventBlockWorkerHeartbeat 其它类型事件
	EventBlockWorkerHeartbeat // blockchain与worker心跳事件
	//EventUpdateBlackList event update blacklist
	EventUpdateBlackList
	//EventSubscriber event subscribe
	EventSubscriber // 订阅数据区块链上数据
	//EventReplySubscriber event reply subscribe
	EventReplySubscriber
	//EventUnsubscriber event unsubscribe
	EventUnsubscriber // 取消订阅数据区块链上数据
	//EventReplyUnsubscriber event reply unsubscribe
	EventReplyUnsubscriber
)

var eventName = map[int]string{
	//EventReply event reply
	EventReply: "EventReply",
	//EventTxQuery event tx query
	EventTxQuery: "EventTxQuery",
	//EventReplyTxQuery event reply query tx
	EventReplyTxQuery: "EventReplyTxQuery",
	//EventTxBroadcast event broadcast tx
	EventTxBroadcast: "EventTxBroadcast",
	//EventTxTotalQuery event query amount of txs
	EventTxTotalQuery: "EventTxTotalQuery",
	//EventReplyTxTotalQuery event reply query amount of txs
	EventReplyTxTotalQuery: "EventReplyTxTotalQuery",
	//EventDelPendingPoolTxs event delete pending pool txs
	EventDelPendingPoolTxs: "EventDelPendingPoolTxs",
	//EventUndoDelPendingPoolTxs event undo delete pending pool txs
	EventUndoDelPendingPoolTxs: "EventUndoDelPendingPoolTxs",
	//EventBroadcastAddBlock event broadcast add block
	EventBroadcastAddBlock: "EventBroadcastAddBlock",
	//EventBroadcastAddBlockReply event reply broadcast add block
	EventBroadcastAddBlockReply: "EventBroadcastAddBlockReply",
	//EventGetBlock event get block
	EventGetBlock: "EventGetBlock",
	//EventRequestBlock event request block
	EventRequestBlock: "EventRequestBlock",
	//EventGetBlocks event get blocks
	EventGetBlocks: "EventGetBlocks",
	//EventReplyGetBlocks event reply get blocks
	EventReplyGetBlocks: "EventReplyGetBlocks",
	//EventGetBlockHeight event get block height
	EventGetBlockHeight: "EventGetBlockHeight",
	//EventReplyBlockHeight event reply block height
	EventReplyBlockHeight: "EventReplyBlockHeight",
	//EventGetExecutedBlock event get executed block
	EventGetExecutedBlock: "EventGetExecutedBlock",
	//EventGetExecutedBlocks event get executed blocks
	EventGetExecutedBlocks: "EventGetExecutedBlocks",
	//EventGetBlockNumber event get block number
	EventGetBlockNumber: "EventGetBlockNumber",
	//EventGetBlockSequence event get block sequence
	EventGetBlockSequence: "EventGetBlockSequence",
	//EventBlockBroadcast event broad cast
	EventBlockBroadcast: "EventBlockBroadcast",
	//EventGetLastBlock event get last block
	EventGetLastBlock: "EventGetLastBlock",
	//EventReplyGetLastBlock event reply get latest block
	EventReplyGetLastBlock: "EventReplyGetLastBlock",
	//EventGetMaxExecutedBlockNumber event get max executed block number
	EventGetMaxExecutedBlockNumber: "EventGetMaxExecutedBlockNumber",
	//EventAddBlock event add block
	EventAddBlock: "EventAddBlock",
	//EventReplyAddBlock event reply add block
	EventReplyAddBlock: "EventReplyAddBlock",
	//EventReplyAddBlocks event reply add blocks
	EventReplyAddBlocks: "EventReplyAddBlocks",
	//EventSaveBlock event save block
	EventSaveBlock: "EventSaveBlock",
	//EventReplySaveBlock event reply save block
	EventReplySaveBlock: "EventReplySaveBlock",
	//EventDelBlock event delete block
	EventDelBlock: "EventDelBlock",
	//EventReplyDelBlock event reply delete block
	EventReplyDelBlock: "EventReplyDelBlock",
	//EventDelPendingPoolBlock event delete pending pool block
	EventDelPendingPoolBlock: "EventDelPendingPoolBlock",
	//EventExecutedBlockResult event get executed block result
	EventExecutedBlockResult: "EventExecutedBlockResult",
	//EventReplyExecutedBlockResult event reply get executed block result
	EventReplyExecutedBlockResult: "EventReplyExecutedBlockResult",
	//EventRequestCurrentSequence event query current sequnece
	EventRequestCurrentSequence: "EventRequestCurrentSequence",
	//EventStoreCurrentBlockSequence event store current block sequence
	EventStoreCurrentBlockSequence: "EventStoreCurrentBlockSequence",
	//EventQueryCurrentBlockSequence event query current block sequence
	EventQueryCurrentBlockSequence: "EventQueryCurrentBlockSequence",

	//EventQueryContract event query contract
	EventQueryContract: "EventQueryContract",
	//EventReplyQueryContract event reply query contract
	EventReplyQueryContract: "EventReplyQueryContract",
	//EventQueryContractTotal event query amount of contracts
	EventQueryContractTotal: "EventQueryContractTotal",
	//EventReplyQueryContractTotal event reply query amount of contracts
	EventReplyQueryContractTotal: "EventReplyQueryContractTotal",
	//EventQueryReceivedBlockTopic event query received block
	EventQueryReceivedBlockTopic: "EventQueryReceivedBlockTopic",
	//EventQueryCheckedBlockTopic event query checked block
	EventQueryCheckedBlockTopic: "EventQueryCheckedBlockTopic",
	//EventQueryExecutedBlockTopic event query executed block
	EventQueryExecutedBlockTopic: "EventQueryExecutedBlockTopic",
	//EventQueryParaChainTxsCollectProgressTopic event query para chain txs
	EventQueryParaChainTxsCollectProgressTopic: "EventQueryParaChainTxsCollectProgressTopic",
	//EventQuerySequenceCenterBlock event query sequence center block
	EventQuerySequenceCenterBlock: "EventQuerySequenceCenterBlock",

	//EventExecTxGroup event execute tx group
	EventExecTxGroup: "EventExecTxGroup",
	//EventReplyExecTxGroup event reply execute tx group
	EventReplyExecTxGroup: "EventReplyExecTxGroup",

	//EventPeerList event query peer list
	EventPeerList: "EventPeerList",
	//EventReplyPeerList event reply query peer list
	EventReplyPeerList: "EventReplyPeerList",
	//EventPeerInfo event query peer info
	EventPeerInfo: "EventPeerInfo",
	//EventReplyPeerInfo event reply query peer info
	EventReplyPeerInfo: "EventReplyPeerInfo",
	//EventFetchBlock event query block
	EventFetchBlock: "EventFetchBlock",
	//EventReplyFetchBlockInfo event reply query block info
	EventReplyFetchBlockInfo: "EventReplyFetchBlockInfo",
	//EventTxPoolPreRemove event pre remove tx pool
	EventTxPoolPreRemove: "EventTxPoolPreRemove",
	//EventTxPoolPreRemoveByHash event pre remove tx from tx pool by hash
	EventTxPoolPreRemoveByHash: "EventTxPoolPreRemoveByHash",
	//EventTxPoolUndoPreRemove event undo pre remove tx from tx pool
	EventTxPoolUndoPreRemove: "EventTxPoolUndoPreRemove",
	//EventTxPoolRemoveTxs event remove txs from tx pool
	EventTxPoolRemoveTxs: "EventTxPoolRemoveTxs",

	//EventConsensusQuery event consensus query
	EventConsensusQuery: "EventConsensusQuery",
	//EventIsSynched evnet node is synchronized
	EventIsSynched: "EventIsSynched",
	//EventStoreElectionContext event store election context
	EventStoreElectionContext: "EventStoreElectionContext",
	//EventRequestElectionContext event request election context
	EventRequestElectionContext: "EventRequestElectionContext",
	//EventStoreRoundMinersInfo event store round miners info
	EventStoreRoundMinersInfo: "EventStoreRoundMinersInfo",
	//EventRequestRoundMinersInfo event request round miners info
	EventRequestRoundMinersInfo: "EventRequestRoundMinersInfo",
	//EventConsensusRequestMsg event consensus msg
	EventConsensusRequestMsg: "EventConsensusRequestMsg",
	//EventConsensusSyncRequestMsg event sync consensus msg
	EventConsensusSyncRequestMsg: "EventConsensusSyncRequestMsg",
	//EventConsensusResponseMsg event consensus response
	EventConsensusResponseMsg: "EventConsensusResponseMsg",

	//EventBlockWorkerHeartbeat event boss worker heart beat
	EventBlockWorkerHeartbeat: "EventBlockWorkerHeartbeat",

	//EventExecutedBlock event executed block
	EventExecutedBlock: "EventExecutedBlock",
	//EventCheckedBlock event checked block
	EventCheckedBlock: "EventCheckedBlock",
	//EventReceivedBlock event received block
	EventReceivedBlock: "EventReceivedBlock",
	//EventAddedBlock event added block
	EventAddedBlock: "EventAddedBlock",

	//EventSubscriber event subscribe
	EventSubscriber: "EventSubscriber",
	//EventReplySubscriber event reply subscribe
	EventReplySubscriber: "EventReplySubscriber",
	//EventUnsubscriber event unsubscribe
	EventUnsubscriber: "EventUnsubscriber",
	//EventReplyUnsubscriber event reply unsubscribe
	EventReplyUnsubscriber: "EventReplyUnsubscriber",

	//EventStoreReceivedBlockTopic event store received block
	EventStoreReceivedBlockTopic: "EventStoreReceivedBlockTopic",
	//EventStoreCheckedBlockTopic event store checked block
	EventStoreCheckedBlockTopic: "EventStoreCheckedBlockTopic",
	//EventStoreExecutedBlockTopic event store executed block
	EventStoreExecutedBlockTopic: "EventStoreExecutedBlockTopic",
	//EventStoreParaChainTxsCollectProgressTopic event store para chain txs
	EventStoreParaChainTxsCollectProgressTopic: "EventStoreParaChainTxsCollectProgressTopic",
}

// contract event
const (
	// ContractEventSysParamUpdate ...
	ContractEventSysParamUpdate = "ContractEventSysParamUpdate"

	// ContractEventConsensusUpdate ...
	ContractEventConsensusUpdate = "ContractEventConsensusUpdate"
)
